home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17776 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: ntc.nokia.com!news
  2. From: Risto Lankinen <risto.lankinen@ntc.nokia.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to copy text to Win95 clipboard?
  5. Date: Wed, 17 Apr 1996 08:48:03 -0700
  6. Organization: Nokia Telecommunications
  7. Message-ID: <317512B3.3469@ntc.nokia.com>
  8. References: <316ff634.6913883@news.demon.co.uk> <4kpl36$j8c@nntp1.best.com>
  9. NNTP-Posting-Host: pc-rlankinen.ntc.nokia.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (Win16; I)
  14.  
  15. Hi!
  16.  
  17. John Lockwood wrote:
  18. > martin@mckean.demon.co.uk (Martin McKean) wrote:
  19. > >How do I set up a handle to a character string so that I can put that
  20. > >string on the clipboard?
  21. > >I'm using VC4++; grateful for any help!!
  22. > Dude, here's a one-shot answer.  But I really urge you to get a copy
  23. > of Charles Petzold's Programming Windows and read it.
  24.  
  25.    [answer deleted]
  26.  
  27. Here's how I copy strings to clipboard:
  28.  
  29. My string class has a static "EDIT" control (wrapped in another class
  30. so that it is appropriately created and deleted as the program begins
  31. and ends).  The string class has a Clip() method, which sets the text
  32. of the "EDIT" control to 'this' string, selects all of the text, and
  33. sends the control a WM_COPY message.  Voila!
  34.  
  35. (That was really a simplification, because actually my "EDIT" control
  36. wrapper class is based on a virtual string interface class, so that
  37. an "EDIT" control really looks like a string.  You can then assign a
  38. string to an "EDIT" control, or use it as an argument in Len(), Mid(),
  39. operator+() etc. string functions... but that's another story... )
  40.  
  41. terv: Risto
  42.  
  43. -- 
  44. Risto Lankinen / System Engineer  ***************************************
  45. Nokia Telecommunications,         *  2                              2   *
  46. Cellular Data; Helsinki, Finland. * 2 -1 is PRIME!  Now working on 2 +1 *
  47. risto.lankinen@ntc.nokia.com      ***************************************
  48.